#include "httprequest.h"
HttpRequest::HttpRequest(QObject * parent):QObject (parent)
{

}
HttpRequest::~HttpRequest(){
    QString info("HttpRequest已析构");
    Loger::info(info);
}

/**
 * 获取请求方式
 * @brief getRequestMethod
 * @return
 */
HttpRequest::RequestMethod HttpRequest:: getRequestMethod(){
    return this->requestMethod;
}
/**
 * 获取请求头
 * @brief getHeader
 * @return
 */
const QMap<QString, QString>& HttpRequest::getHeader(){
    return this->requestHeader;
}

/**
 * 获取请求路径
 * @brief getRequestUri
 * @return
 */
const QString& HttpRequest::getRequestUri(){
    return this->requestUri;
}
/**
 * 获取请求参数
 * @brief getParams
 * @return
 */
const QMap<QString, QString>& HttpRequest::getParams(){
    return this->params;
}
/**
 * 获取请求体
 * @brief getData
 * @return
 */
qint64 HttpRequest::getRequestBody(char *buf, int bufSize){
    return conn->read(buf, bufSize);
}
/**
 * 获取请求参数
 * @brief getParameter
 * @param paramName
 * @return
 */
QString HttpRequest::getParameter(QString& paramName){
    QString value =  params.value(paramName);
    return value;
}

